<?php
header('Content-Type: text/html; charset=UTF-8');
require_once('../controllers/UIs/UIFactor.php');
session_start();
			$enum = $_POST['enunciado'];
			$fecha_reg = date("Y-m-d");
			$fecha_mod = date("Y-m-d");
			$exist=insertarFactor($enum, $fecha_reg, $fecha_mod, $_SESSION['login']);


                        if ($exist!=false)
                        echo '<script type="text/javascript">
                            window.alert("Factor insertado exitosamente")
                            </script>
                            <script type="text/javascript">
                            <!--
                            window.location = "factor.php"
                            //-->
                            </script>';

                        else
                        echo '<script type="text/javascript">
                            window.alert("el factor ya existe en el sistema")
                            </script>
                            <script type="text/javascript">
                            <!--
                            window.location = "factor.php"
                            //-->
                            </script>';

		?>